﻿
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title> 
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet"  type="text/css" />
    <link href="../../../Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../../Comm/Gener.js"></script>
    <script src="DDLBar.js" type="text/javascript"></script>
    <script src="../../CCFlowEnum.js" type="text/javascript"></script>
    <script src="../../../Scripts/EasyUIUtility.js" type="text/javascript"></script>

    <script  type="text/javascript">

        $(function () {

            InitBar(DeliveryWay.ByPreviousNodeFormEmpsField);
            var nodeID = GetQueryString("FK_Node");
            var node = new Entity("BP.WF.Node", nodeID);
            var FK_Flow = node.FK_Flow;

            var FK_MapData = "ND" + parseInt(FK_Flow) + "Rpt";

            var mapAttrs = new Entities("BP.Sys.MapAttrs", "FK_MapData", FK_MapData)

            var str = "";
            str += "&nbsp;<select id='RB_ByPreviousNodeFormEmpsField'>" + InitDDLOperation(mapAttrs) + "</select>";

            document.getElementById("DDL_ByPreviousNodeFormEmpsField").innerHTML = str; //设置基础信息.

            //初始话下拉列表值
            if (node.DeliveryWay == DeliveryWay.ByPreviousNodeFormEmpsField) {
                if (node.DeliveryParas != null && node.DeliveryParas != "")
                    $("#RB_ByPreviousNodeFormEmpsField").val(node.DeliveryParas);
            }

        });

        //初始化下拉列表框的OPERATION
        function InitDDLOperation(mapAttrs) {
 
            var operations = "";

            for (var i = 0; i < mapAttrs.length; i++) {

                var mapAttr = mapAttrs[i];

                if (mapAttr.KeyOfEn == undefined)
                    operations += "<option value='" + mapAttr.IntKey + "'>" + mapAttr.Lab + "</option>";
                else
                    operations += "<option value='" + mapAttr.KeyOfEn + "'>" + mapAttr.KeyOfEn + "&nbsp;" + mapAttr.Name + "</option>";
            }
            return operations;
        }

        function Save() {
            var nodeID = GetQueryString("FK_Node");
            var node = new Entity("BP.WF.Node", nodeID);
            node.DeliveryWay = DeliveryWay.ByPreviousNodeFormEmpsField;
            var DeliveryParas = $("#RB_ByPreviousNodeFormEmpsField ").val();
            node.DeliveryParas = DeliveryParas;
            node.Update();
            alert("保存成功.");
        }
    </script>
</head>
<body >

<div id="bar"> </div>
<fieldset>
    <legend>请选择一个字段.</legend>
    请选择一个节点字段:  <label id="DDL_ByPreviousNodeFormEmpsField"></label>
</fieldset>
</body>
</html>
